package com.bw.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bw.entity.User;
import com.bw.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.security.PrivateKey;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lizhengqian
 * @since 2020-05-29
 */
@RestController

@RequestMapping("user")
public class UserController {
    @Autowired
    IUserService iUserService;

    @PostMapping("login")
    public String login(@RequestBody User user) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("uname", user.getUname());
        wrapper.eq("pwd", user.getPwd());
        iUserService.getOne(wrapper);
        return " 登录成功";

    }
}
